(function(){
    'use strict';
    var editor = new wangEditor('#diaryEditor');
    editor.create();
    $('#saveDiary').on('click',function(){
        var $form = $('#diaryForm');
        var title = $('input[name="title"]').val();
        var weather = $('input[name="weather"]').val();
        $.ajax({
            url: '/api/user/diary/add',
            type: 'post',
            data: {
                title: title,
                weather: weather,
                content: editor.txt.html()
            },
            dataType: 'json',
            success: function(res){

            }
        })
    })
})();